package shopping;

public class ShoppingMallTest {
    public static void main(String[] args) {
        // Create shopping mall
        ShoppingMall mall = new ConcreteShoppingMall();
        
        // Test adding members
        mall.addMember("M01 M 28 G");  // Gold card member
        mall.addMember("M02 F 25 S");  // Silver card member
        
        // Test placing orders for gold card member
        System.out.println("\nTesting Gold Card Member orders:");
        double payment1 = mall.placeOrder("M01", 1500, ProductCategory.SKINCARE);
        System.out.println("Payment for 1500: " + payment1);  // Should be 1500
        
        double payment2 = mall.placeOrder("M01", 4000, ProductCategory.WATCH);
        System.out.println("Payment for 4000: " + payment2);  // Should be 3900 (2000 + 2000*0.95)
        
        double payment3 = mall.placeOrder("M01", 8000, ProductCategory.JEWELRY);
        System.out.println("Payment for 8000: " + payment3);  // Should be 7400
        
        // Test placing orders for silver card member
        System.out.println("\nTesting Silver Card Member orders:");
        payment1 = mall.placeOrder("M02", 2000, ProductCategory.PERFUME);
        System.out.println("Payment for 2000: " + payment1);  // Should be 2000, earns 2000 points
        
        payment2 = mall.placeOrder("M02", 12000, ProductCategory.DIGITAL_PRODUCT);
        System.out.println("Payment for 12000: " + payment2);  // Should use points and earn more
        
        // Test getting member records
        System.out.println("\nMember M01 records:");
        for (String record : mall.getMemberRecords("M01")) {
            System.out.println(record);
        }
        
        // Test getting cost by category
        System.out.println("\nCost by category:");
        for (String categoryStats : mall.getCostByCategory()) {
            System.out.println(categoryStats);
        }
        
        // Test getting member records by gender and age
        System.out.println("\nMale members aged 20-30:");
        for (String memberStats : mall.getMemberRecordByGenderAndAge('M', 20, 30)) {
            System.out.println(memberStats);
        }
        
        // Test getting total cost for a member
        System.out.println("\nTotal cost for M01: " + mall.getTotalCost("M01"));
        
        // Test getting total income
        System.out.println("Total mall income: " + mall.getTotalIncome());
    }
} 